<style>
    .layui-table-click{
        background-color: #FFE48D;
    }
</style>
<script>
    window.p = {
        data : {}
    };

    layui.use(['table'], function () {
        var table = layui.table,
            $ = layui.$;
        //当前菜单所对应的按钮动作权限
        var menuMotions = '${PARAM_MENU_MOTIONS}' || '[]';
        menuMotions = JSON.parse(menuMotions);
        var button = "";
        var buttons = [];
        $.each(menuMotions,function(index,btn){
            buttons.push('<a class="layui-btn layui-btn-xs" lay-event="'+ btn.motionCode +'">'+ btn.motionName +'</a>');
        });
        button = "<div class=\"layui-btn-group\">"+buttons.join('')+"</div>";
        $("#toolbar").append(button).css({width:'100%'});
        //监听table单击事件
        table.on('row(lay-table)', function(obj){
            var $tr = $(".layui-table tbody tr");
            $tr.removeClass("layui-table-click");
            obj.tr.addClass("layui-table-click");
            p.data = obj.data;
        });
    });
</script>